<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>

    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />

    <title>后台信息管理系统</title>

    <link th:href="@{../../css/bootstrap.min.css}" rel="stylesheet" />
    <link th:href="@{../../font-awesome/css/font-awesome.css}" rel="stylesheet" />

    <!-- Toastr style -->
    <link th:href="@{../../css/plugins/toastr/toastr.min.css}" rel="stylesheet"/>

    <link th:href="@{../../css/styleManage.css}" rel="stylesheet" />

    <!-- summernote style -->
    <link th:href="@{../../css/plugins/summernote/summernote.css}" rel="stylesheet" />
    <link th:href="@{../../css/plugins/summernote/summernote-bs3.css}" rel="stylesheet" />

</head>

<body>

<div id="wrapper">
    <nav class="navbar-default navbar-static-side" role="navigation" th:include="/manage/nav :: navigation"></nav>
    <div id="page-wrapper" class="gray-bg">
        <div class="border-bottom" th:include="/manage/header :: headerTop"></div>
        <div class="row wrapper border-bottom white-bg page-heading" th:fragment="headerNav">
            <div class="col-lg-10">
                <h2>用户管理</h2>
                <ol class="breadcrumb">
                    <li>
                        <a href="/manage/viewAccountInfor">首页</a>
                    </li>
                    <li>
                        <a href="/manage/viewAccountInfor">用户管理</a>
                    </li>
                    <li class="active">
                        <strong>修改用户信息</strong>
                    </li>
                </ol>
            </div>
            <div class="col-lg-2">
            </div>
        </div>
        <div class="wrapper wrapper-content animated fadeInRight">
            <div class="row">
                <div class="col-lg-12">
                    <div class="ibox float-e-margins">
                        <div class="ibox-title">
                            <h5>修改用户信息</h5>
                            <div class="ibox-tools">
                                <a class="collapse-link">
                                    <i class="fa fa-chevron-up"></i>
                                </a>
                            </div>
                        </div>
                        <div class="ibox-content">
                            <form id="formTag" action="/manage/updateInformation" method="POST" class="form-horizontal" enctype="multipart/form-data">

                                <div class="form-group"><label class="col-sm-2 control-label">User ID:</label>
                                    <div class="col-sm-10">
                                        <input id="username" name="username" readonly="readonly" type="text" class="form-control" th:value="${account.username}"/>
                                    </div>
                                </div>

                                <div class="hr-line-dashed"></div>

                                <div class="form-group"><label class="col-sm-2 control-label">Password:</label>
                                    <div class="col-sm-10">
                                        <input id="password" name="password" type="text" class="form-control" th:value="${account.password}"/>
                                    </div>
                                </div>

                                <div class="hr-line-dashed"></div>

                                <div class="form-group"><label class="col-sm-2 control-label">First name:</label>
                                    <div class="col-sm-10">
                                        <input id="firstname" name="firstname" type="text" class="form-control" th:value="${account.firstName}"/>
                                    </div>
                                </div>

                                <div class="hr-line-dashed"></div>

                                <div class="form-group"><label class="col-sm-2 control-label">Last name:</label>
                                    <div class="col-sm-10">
                                        <input id="lastname" name="lastname" type="text" class="form-control" th:value="${account.lastName}"/>
                                    </div>
                                </div>

                                <div class="hr-line-dashed"></div>

                                <div class="form-group"><label class="col-sm-2 control-label">Email:</label>
                                    <div class="col-sm-10">
                                        <input id="email" name="email" type="text" class="form-control" th:value="${account.email}"/>
                                    </div>
                                </div>

                                <div class="hr-line-dashed"></div>

                                <div class="form-group"><label class="col-sm-2 control-label">Phone:</label>
                                    <div class="col-sm-10">
                                        <input id="phone" name="phone" type="text" class="form-control" th:value="${account.phone}"/>
                                    </div>
                                </div>

                                <div class="form-group"><label class="col-sm-2 control-label">Status:</label>
                                    <div class="col-sm-10">
                                        <input id="status" name="status" type="text" class="form-control" th:value="${account.status}"/>
                                    </div>
                                </div>

                                <div class="form-group"><label class="col-sm-2 control-label">Address 1:</label>
                                    <div class="col-sm-10">
                                        <input id="address1" name="address1" type="text" class="form-control" th:value="${account.address1}"/>
                                    </div>
                                </div>

                                <div class="form-group"><label class="col-sm-2 control-label">Address 2:</label>
                                    <div class="col-sm-10">
                                        <input id="address2" name="address2" type="text" class="form-control" th:value="${account.address2}"/>
                                    </div>
                                </div>

                                <div class="form-group"><label class="col-sm-2 control-label">City:</label>
                                    <div class="col-sm-10">
                                        <input id="city" name="city" type="text" class="form-control" th:value="${account.city}"/>
                                    </div>
                                </div>

                                <div class="form-group"><label class="col-sm-2 control-label">State:</label>
                                    <div class="col-sm-10">
                                        <input id="state" name="state" type="text" class="form-control" th:value="${account.state}"/>
                                    </div>
                                </div>

                                <div class="form-group"><label class="col-sm-2 control-label">Zip:</label>
                                    <div class="col-sm-10">
                                        <input id="zip" name="zip" type="text" class="form-control" th:value="${account.zip}"/>
                                    </div>
                                </div>

                                <div class="form-group"><label class="col-sm-2 control-label">Country:</label>
                                    <div class="col-sm-10">
                                        <input id="country" name="country" type="text" class="form-control" th:value="${account.country}"/>
                                    </div>
                                </div>

                                <div class="form-group"><label class="col-sm-2 control-label">Language Preference:</label>
                                    <div class="col-sm-10">
                                        <select name="languagePreference" id="languagePerference">
                                            <!--                                <option value="english" selected="selected">english</option>-->
                                            <!--                                <option value="japanese">japanese</option>-->
                                            <option value="English" th:selected="${account.languagePreference eq 'English'}" >English</option>
                                            <option value="Chinese" th:selected="${account.languagePreference eq 'Chinese'}" >Chinese</option>
                                            <option value="Japanese" th:selected="${account.languagePreference eq 'Japanese'}" >Japanese</option>
                                            <option value="Korean" th:selected="${account.languagePreference eq 'Korean'}" >Korean</option>
                                            <option value="German" th:selected="${account.languagePreference eq 'German'}" >German</option>
                                            <option value="French" th:selected="${account.languagePreference eq 'French'}" >French</option>
                                        </select>
                                    </div>
                                </div>

                                <div class="form-group"><label class="col-sm-2 control-label">Favourite Category:</label>
                                    <div class="col-sm-10">
                                        <select name="favouriteCategoryId" id="favouriteCategoryId">
                                            <option value="FISH" th:selected="${account.favouriteCategoryId eq 'FISH'}">FISH</option>
                                            <option value="DOGS" th:selected="${account.favouriteCategoryId eq 'DOGS'}">DOGS</option>
                                            <option value="REPTILES" th:selected="${account.favouriteCategoryId eq 'REPTILES'}">REPTILES</option>
                                            <option value="CATS" th:selected="${account.favouriteCategoryId eq 'CATS'}">CATS</option>
                                            <option value="BIRDS" th:selected="${account.favouriteCategoryId eq 'BIRDS'}">BIRDS</option>
                                        </select>
                                    </div>
                                </div>

                                <div class="form-group"><label class="col-sm-2 control-label">Enable MyList</label>
                                    <div class="col-sm-10">
                                        <input type="checkbox" name="listOption" value="1" th:checked="${account.listOption==true}"/>
                                    </div>
                                </div>

                                <div class="form-group"><label class="col-sm-2 control-label">Enable MyBanner</label>
                                    <div class="col-sm-10">
                                        <input type="checkbox" name="bannerOption" th:value="1" th:attr ="checked=${account.bannerOption==true?true:false}"/>
                                    </div>
                                </div>

                                <div class="hr-line-dashed"></div>
                                <div class="form-group">
                                    <div class="col-sm-4 col-sm-offset-2">
                                        <button id="submitButton" class="btn btn-primary">&nbsp;&nbsp;&nbsp;&nbsp;提&nbsp;&nbsp;&nbsp;&nbsp;交&nbsp;&nbsp;&nbsp;&nbsp;</button>
                                    </div>
                                </div>
                                <p>
                                    <font color="#FF6984" th:text="${msg}">${requestScope.msg}</font>
                                </p>
                            </form>
                        </div>
                    </div>
                </div>
            </div>

        </div>
        <div class="footer" th:include="/manage/footer :: copyright"></div>
    </div>
</div>

<!-- Mainly scripts -->
<script th:src="@{../../js/jquery-2.1.1.js}"></script>
<script th:src="@{../../js/bootstrap.min.js}"></script>
<script th:src="@{../../js/plugins/metisMenu/jquery.metisMenu.js}"></script>
<script th:src="@{../../js/plugins/slimscroll/jquery.slimscroll.min.js}"></script>

<!-- Peity -->
<script th:src="@{../../js/plugins/peity/jquery.peity.min.js}"></script>

<!-- Custom and plugin javascript -->
<script th:src="@{../../js/inspinia.js}"></script>
<script th:src="@{../../js/plugins/pace/pace.min.js}"></script>

<!-- Toastr script -->
<script th:src="@{../../js/plugins/toastr/toastr.min.js}"></script>

<!-- common -->
<script th:src="@{../../js/common.js}"></script>

<!-- SUMMERNOTE -->
<script th:src="@{../../js/plugins/summernote/summernote.min.js}"></script>


<script th:inline="javascript">
    var image = [[${item.image}]];
    $(document).ready(function () {
        if(image==null || image==""){
            $("#imageCell").hide();
            $("#imputCell").show();
        } else {
            $("#imageCell").show();
            $("#imputCell").hide();
        }
        $("#imageCellBut").click(function(){
            $("#imageCell").hide();
            $("#imputCell").show();
        });
    });
</script>
<script th:inline="javascript">
    $(document).ready(function () {
        //初始化编辑器
        $('#summernote').summernote({
            height: 300,
            codemirror: {
                mode: 'text/html',
                htmlMode: true,
                lineNumbers: true,
                theme: 'monokai'
            }
        });
        //编辑器赋值

        //提交
        $("#submitButton").click(function(){
            if($("#title").val() == ""){
                toastr.error('请输入商品标题','提示');
                return;
            }
            if($("#category").val() == 0){
                toastr.error('请选择商品分类','提示');
                return;
            }
            if($("#price").val() == 0){
                toastr.error('请输入商品价格','提示');
                return;
            }
            if($("#num").val() == 0){
                toastr.error('请输入库存数量','提示');
                return;
            }
            $("#formTag").submit();
        });
    });
</script>

</body>

</html>
